import axios from '@/libs/api.request'

/**
 * 获取表格数据
 * @return {[type]}        [description]
 */
export const fetchTableData = params => {
  return axios.request({
    url: '/api/forecast/getMeterListPaged',
    method: 'get',
    params
  })
}

/**
 * 获取矩形方图数据
 * @return {[type]}        [description]
 */
export const fetchTreeMap = params => {
  return axios.request({
    url: '/api/meterManage/meyerQuery/getMeterGasCalssCountByYear',
    method: 'get',
    params
  })
}

/**
 * desc: 获取K线图数据
 * param {type}
 * return {type} void
 */
export const fetchKXData = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getMeterKLineByYear',
    method: 'get',
    params
  })
}

export const fetchAbnormalData = params => {
  return axios.request({
    url: '/api/localDataMonth/getMeterDetailByDay',
    method: 'get',
    params
  })
}

/**
 * desc: 用气量统计
 * param {type}
 * return {type} void
 */
export const fetchYqltjData = params => {
  return axios.request({
    url: '/api/gasMonitoring/getMeterGasByHoursSection',
    method: 'get',
    params
  })
}

/**
 * desc: 线性拟合
 * param {type}
 * return {type} void
 */
export const fetchXxlhData = data => {
  return axios.request({
    url: '/api/gasMonitoring/getLinearFitting',
    method: 'post',
    data
  })
}

/**
 * desc: 小时用气模式
 * param {type}
 * return {type} void
 */
export const fetchXsyqmsData = data => {
  return axios.request({
    url: '/api/gasMonitoring/getGasMonitoringClustering',
    method: 'post',
    data
  })
}

export const fetchCdrkData = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getExternalData',
    method: 'get',
    params
  })
}
export const fetchLyqltjData = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getZeroGasDistributionStatistics',
    method: 'get',
    params
  })
}
export const fetchDsycData = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getAbnormalReadings',
    method: 'get',
    params
  })
}
export const fetchSjqsData = (params) => {
  return axios.request({
    url: '/api/gasMonitoring/getDataMissing',
    method: 'get',
    params
  })
}

export const fetchCcfxData = params => {
  return axios.request({
    url: '/api/gasMonitoring/getAccessOftenPoor',
    method: 'get',
    params
  })
}

export const fetchSaveParams = data => {
  return axios.request({
    url: '/api/gasMonitoring/addAnomalyParam',
    method: 'post',
    data
  })
}

export const fetchLoadData = params => {
  return axios.request({
    url: '/api/gasMonitoring/dataLoading',
    method: 'get',
    params
  })
}

export const fetchErrorTypes = params => {
  return axios.request({
    url: '/api/gasMonitoring/getQuickEntry',
    method: 'get',
    params
  })
}
